package com.jeecg.utils;

import java.lang.reflect.Field;

import javax.servlet.http.HttpServletRequest;

public class FullBeansUtils {
	
	public static Object setValue(HttpServletRequest request, String beanName) {

		Object obj = null;
		Class clazz = null;

		try {

			clazz = Class.forName(beanName);

			obj = clazz.newInstance();
			for (Field field : clazz.getDeclaredFields()) {

				field.setAccessible(true);
				field.set(obj, request.getParameter(field.getName()));

				field.setAccessible(false);
			}

		} catch (Exception e) {

			e.printStackTrace();
		}

		return obj;

	}
	
}
